<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>compositebox</title>
<link rel="stylesheet" type="text/css" href="../css/ye.check.css" />
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript" src="../js/ye.check.js"></script>
<script type="text/javascript" src="../js/jquery.compositebox.js"></script>
<style type="text/css">
#form1 li {
	height: 45px;
	list-style: none;
}

.b {
	width: 30%;
	display: block;
	text-align: right;
	float: left;
}

span {
	display: inline-block;
	text-align: left;
	float: left;
}
</style>
</head>
<body>
	<div>
		<form method="post" id="form1">
			<ul>
				<li><label class="b">用户名：</label> <span><input type="text"
						name="username" id="username" rule="require" /></span></li>
				<li><label class="b">密码：</label> <span><input type="text"
						name="password" id="password" rule="require" /></span></li>
				<li><label class="b">手机号码：</label> <span><input type="text"
						name="mobile" id="mobile" rule="mobile" /></span></li>
				<li><label class="b">身份证号码：</label> <span><input type="text"
						name="idcard" id="idcard" rule="idcard" /></span></li>
				<li><label class="b">性别：</label>
						<span>
							<input type="radio" class="ye-3checkbox" composite-box="checked" name="sex" rule="radio" value="1"/>男
							<input type="radio" class="ye-3checkbox" composite-box="del" name="sex" rule="radio" value="0"/>非男
						</span>
				</li>
				<li><label class="b">年龄：</label> <span><input type="text"
						name="age" id="age" check-conf="{agestart:18,ageend:60}" /></span></li>
				<li><label class="b">ip：</label> <span><input type="text"
						name="ip" id="ip" /></span></li>
				<li><label class="b">&nbsp;</label> <span> <input type="button"
						id="post" value="提交" onclick="do_post();" />
				</span></li>
		</form>
	</div>
	<script type="text/javascript">
		$('.ye-3checkbox').compositebox();

		function do_post() {
			ye.check({
				'username' : [ 'require', '不能为空', '&nbsp;' ],
				'password' : [ 'require', '不能为空', '&nbsp;' ],
				'mobile' : [ 'mobile', '不能为空', '&nbsp;' ],
				'idcard' : [ 'idcard', '不能为空', '&nbsp;' ],
				'sex' : [ 'radio', '不能为空', '&nbsp;' ],
				'age' : [ 'age', '年龄格式错误', '&nbsp;' ],
				'ip' : [ 'ip', '格式错误', '&nbsp;' ]
			}).do_post({
				msg : {
					right : 'dright',
					error : 'derr'
				},
				form : ye.g('form1'),
				btn : {
					name : 'post',
					text : 'load...'
				}
			});
		}
	</script>
</body>
</html>
